package com.my.hotel.controller;

import com.my.hotel.entity.Eva;
import com.my.hotel.service.EvaService;
import com.my.hotel.service.OrderService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.Date;

@Controller
@RequestMapping("/eva1")
public class EvaController {
    @Autowired
    private EvaService evaService;


    // 添加评论信息
    @RequestMapping("/addEva")
    public String addEva(Eva eva){
        Date date = new Date();
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String evaTime = format.format(date);
        eva.setEvaTime(evaTime);
        eva.setAppStatus("0");
        eva.setDzNum(0);
        evaService.addEva(eva);
        return "success";
    }
}
